package com.saint.farmshop.Controller;

import com.saint.farmshop.Entity.ProductionSecondType;
import com.saint.farmshop.Entity.ProductionType;
import com.saint.farmshop.Service.ServiceImpl.ProductionSecondTypeSeviceImpl;
import com.saint.farmshop.Service.ServiceImpl.ProductionTypeServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 产品类型控制器
 *
 * @author Saint
 * @date 2022/05/22
 */
@Slf4j
@RestController
@RequestMapping("/type")
public class ProductionTypeController {

    @Resource
    ProductionTypeServiceImpl productionTypeService;

    @Resource
    ProductionSecondTypeSeviceImpl productionSecondTypeSevice;

    @RequestMapping("/getTypeList")
    public List<ProductionType> getTypeList(){
        return productionTypeService.getProductionTypeList();
    }

    @RequestMapping("/getSecondTypeListById")
    public List<ProductionSecondType> getSecondTypeListById(String typeId){
        return productionSecondTypeSevice.getSecondTypeListById(typeId);
    }
}
